<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class M_rute extends CI_Model {
	
    function __construct()
    {
        parent::__construct();
    }
    
    function get_rute()
    {
        $this->db->select('*');
        $this->db->from('rute_event');
        $this->db->join('frum_meta','frum_meta.user_id = rute_event.user_id');
        $params = $this->db->get();
        return $params->result();
    }
    
    function input_rute()
	{
		$now = date("Y-m-d H-i-s");
        $data['Judul']         = $this->input->post("judul");
        $data['Tanggal']       = $this->input->post("tanggal");
        $data['Deskripsi']     = $this->input->post("deskripsi");
        $data['waypoints_a']   = $this->input->post("titik1");
        $data['waypoints_b']   = $this->input->post("titik2");
        $data['waypoints_c']   = $this->input->post("titik3");
        $data['waypoints_d']   = $this->input->post("titik4");
        $data['waypoints_f']   = $this->input->post("titik5");
        $data['user_id']       = '1';
		return $this->db->insert("rute_event",$data);
	}
}